/***
 * 此util主要提供一些简单的公共服务
 */
import Constants from "../constants/Constants"


class CommonUtil{

  // 判断字符数组中是否有某个字符
  judgeWeek(weekString:string,weekIndex:string):boolean{
    let statu:boolean = false;
    for (const item of weekString.split(",")) {
      if (item == weekIndex) {
        statu = true;
        break;
      }
    }
    return statu;
  }

  //随机返回任务列表的颜色
  returnManagerColor() : string {
    let ColoList:string[] = Constants.ManageColorList;
    let colorIndex:number = Math.floor(Math.random() * (3 - 0) ) + 0;
    return ColoList[colorIndex];
  }

}

let commonUtil = new CommonUtil();
export default commonUtil as CommonUtil;